﻿IF EXISTS (SELECT * from sys.procedures p left join sys.schemas s on p.schema_id = s.schema_id where p.name='line_update' and s.name='Budget')
DROP PROCEDURE [Budget].line_update
GO
CREATE PROCEDURE [Budget].line_update 
@PK uniqueidentifier, 
@BudgetID uniqueidentifier, 
@CategoryID uniqueidentifier, 
@ParentID uniqueidentifier, 
@Code nvarchar(50), 
@Name nvarchar(200), 
@Amount decimal(10, 2), 
@Description nvarchar(200)
AS
BEGIN
UPDATE [Budget].[Lines] 
SET	[id_budget] = @BudgetID ,
	[id_category] = @CategoryID ,
	[id_parent] = @ParentID ,
	[code] = @Code ,
	[name] = @Name ,
	[amount] = @Amount ,
	[description] = @Description 
WHERE
	[id_line] = @PK 
END